<?php
// +----------------------------------------------------------------------
// | ThinkPHP [ WE CAN DO IT JUST THINK ]
// +----------------------------------------------------------------------
// | Copyright (c) 2006~2018 http://thinkphp.cn All rights reserved.
// +----------------------------------------------------------------------
// | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
// +----------------------------------------------------------------------
// | Author: liu21st <liu21st@gmail.com>
// +----------------------------------------------------------------------
use think\facade\Route;
Route::group(function () {
    Route::post('config/index', 'Config/index');
    Route::post('config/Timing', 'Config/Timing');
    Route::post('install/isInstall', 'Install/isInstall');
    Route::post('install/index', 'Install/index');
    Route::get('captcha','Verify/index');
    Route::post('login','Staff/login');
    Route::post('captcha','Verify/index');
    Route::post('upload','Config/upload');
    Route::post('version/index','version/index');
    Route::post('version/versionList','Version/versionList');
    Route::post('version/pirate','Version/pirate');
    Route::post('version/isNew','version/isNew');
    Route::post('version/getH5Zip','version/getH5Zip');

})->middleware(\app\http\middleware\AllowOrigin::class);
Route::group(function () {
    Route::group(function () {
        Route::get('system/menu', 'Menu/index');
        Route::post('system/menu/add', 'Menu/add')
            ->middleware(\app\http\middleware\AdminLog::class, '添加菜单');
        Route::post('system/menu/edit', 'Menu/edit')
            ->middleware(\app\http\middleware\AdminLog::class, '修改菜单');
        Route::post('system/menu/del', 'Menu/del')
            ->middleware(\app\http\middleware\AdminLog::class, '删除菜单');
    });
    Route::post('Config/edit', 'Config/edit');
    Route::group(function () {
        Route::get('auth/user','Staff/user');

        Route::get('system/user','Staff/userList');
        Route::get('system/role','Role/roleList');
        Route::post('system/rolePage','Role/rolePage');
        Route::post('system/role/add','Role/add')
            ->middleware(\app\http\middleware\AdminLog::class,'添加角色');
        Route::post('system/role/edit','Role/edit')
            ->middleware(\app\http\middleware\AdminLog::class,'编辑角色');
        Route::post('system/roleMenu','Role/roleMenu');
        Route::post('roleMenu/roleMenuEdit','Role/roleMenuEdit')
            ->middleware(\app\http\middleware\AdminLog::class,'修改角色权限菜单');
        Route::post('system/user/add','Staff/addStaff')
            ->middleware(\app\http\middleware\AdminLog::class,'添加账号');
        Route::post('system/user/update','Staff/staffUpdate')
            ->middleware(\app\http\middleware\AdminLog::class,'修改后台管理员');
        Route::post('system/user/password','Staff/password')
            ->middleware(\app\http\middleware\AdminLog::class,'修改后台管理员密码');
        Route::post('user/setAmount','User/setAmount')
            ->middleware(\app\http\middleware\AdminLog::class,'修改用户余额');
        Route::post('user/checkUser','User/checkUser');
        Route::post('user/agreeCheck','User/agreeCheck');
        Route::post('user/chatLog','User/chatLog');

    });
    Route::group(function () {
        Route::post('addmenu', 'HomeMenu/addMenu')
            ->middleware(\app\http\middleware\AdminLog::class,'添加公众号菜单');
        Route::post('editmenu', 'HomeMenu/editMenu')
            ->middleware(\app\http\middleware\AdminLog::class,'修改公众号菜单');
        Route::post('savemenu', 'HomeMenu/savemenu')
            ->middleware(\app\http\middleware\AdminLog::class,'推送菜单');
        Route::post('delmenu', 'HomeMenu/delMenu')
            ->middleware(\app\http\middleware\AdminLog::class,'删除公众号菜单');
        Route::post('menu', 'HomeMenu/menu');
    });
    Route::group(function () {
        Route::post('poster/posterList', 'Poster/posterList');
        Route::post('poster/addPoster', 'Poster/addPoster')
            ->middleware(\app\http\middleware\AdminLog::class, '添加图');
        Route::post('poster/editPoster', 'Poster/editPoster')
            ->middleware(\app\http\middleware\AdminLog::class, '编辑图');
        Route::post('poster/delPoster', 'Poster/delPoster')
            ->middleware(\app\http\middleware\AdminLog::class, '删除图片');
    });
    Route::group(function () {
        Route::post('level/addLevel', 'Level/addLevel')
            ->middleware(\app\http\middleware\AdminLog::class,'添加会员等级');
        Route::post('level/levelList', 'Level/levelList');
        Route::post('level/editLevel', 'Level/editLevel')
            ->middleware(\app\http\middleware\AdminLog::class,'编辑会员等级');
        Route::post('level/updateLevelStatus', 'Level/updateLevelStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改会员状态');


        Route::post('level/addLevelCami', 'Level/addLevelCami')
            ->middleware(\app\http\middleware\AdminLog::class,'添加会员卡密');
        Route::post('level/camiList', 'Level/camiList');
        Route::post('level/deleteCami', 'Level/deleteCami')
            ->middleware(\app\http\middleware\AdminLog::class,'删除会员卡密');
        Route::post('level/userLevelOrderList', 'Level/userLevelOrderList');
        Route::post('level/userLevelList', 'Level/userLevelList');
    });
    Route::group(function (){
        Route::post('log/imgLog', 'Log/imgLog');
        Route::post('log/uploadImg', 'Log/uploadImg');
        Route::post('log/uploadDel', 'Log/uploadDel');
    });
    Route::group(function (){
        Route::post('user/userList', 'User/userList');
        Route::post('user/userInfo', 'User/userInfo');
        Route::post('user/updateStatus', 'User/updateStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改用户状态');
        Route::post('user/setTopUser', 'User/setTopUser')
            ->middleware(\app\http\middleware\AdminLog::class,'设置用户上级');
        Route::post('user/authentication', 'User/authentication')
            ->middleware(\app\http\middleware\AdminLog::class,'实名认证');
        Route::post('user/distributionLog', 'User/distributionLog');
        Route::post('user/amountLog', 'User/amountLog');
        Route::post('user/followUser', 'User/FollowUser');

    });
    Route::group(function (){
        Route::post('tabClass/TabClass', 'TabClass/tabList');
        Route::post('tabClass/addTab', 'TabClass/addTab')
            ->middleware(\app\http\middleware\AdminLog::class,'添加tab分类');
        Route::post('tabClass/editTab', 'TabClass/editTab')
            ->middleware(\app\http\middleware\AdminLog::class,'修改tab分类');
        Route::post('tabClass/updateStatus', 'TabClass/updateStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改tab分类状态');
    });
    Route::group(function (){
        Route::post('tabClass/labelList', 'TabClass/labelList');
        Route::post('tabClass/addLabel', 'TabClass/addLabel')
            ->middleware(\app\http\middleware\AdminLog::class,'添加标签');
        Route::post('tabClass/editLabel', 'TabClass/editLabel')
            ->middleware(\app\http\middleware\AdminLog::class,'修改标签');
        Route::post('tabClass/updateLabel', 'TabClass/updateLabel')
            ->middleware(\app\http\middleware\AdminLog::class,'修改标签状态');
    });
    Route::group(function () {
        Route::post('daziList', 'Dazi/daziList');
        Route::post('joinDaziList', 'Dazi/joinDaziList');
        Route::post('daziInfo', 'Dazi/daziInfo');
        Route::post('updateDaziStatus', 'Dazi/updateDaziStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改搭子状态');;
        Route::post('kickUser', 'Dazi/kickUser')
            ->middleware(\app\http\middleware\AdminLog::class,'踢出搭子用户');
        Route::post('editDazi', 'Dazi/editDazi')
            ->middleware(\app\http\middleware\AdminLog::class,'编辑搭子');
        Route::post('kickAllUser', 'Dazi/kickAllUser')
            ->middleware(\app\http\middleware\AdminLog::class,'踢出全部搭子用户');
        Route::post('daziTopList', 'Dazi/daziTopList');

    });
    Route::group(function () {
        Route::post('serviceList', 'Service/serviceList');
        Route::post('serviceOrder', 'Service/serviceOrder');
        Route::post('refuseServiceOrder', 'Service/refuseServiceOrder')
            ->middleware(\app\http\middleware\AdminLog::class,'驳回服务订单');
        Route::post('settlementService', 'Service/settlementService')
            ->middleware(\app\http\middleware\AdminLog::class,'完成服务');
        Route::post('upServiceStatus', 'Service/upServiceStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改服务状态');
        Route::post('serviceTopList', 'Service/serviceTopList');
        Route::post('refuseAllOrder', 'Service/refuseAllOrder');
    });
    Route::group(function () {
        Route::Post('pay/addPayAmount', 'Pay/addPayAmount')
            ->middleware(\app\http\middleware\AdminLog::class,'添加支付金额配置');
        Route::Post('pay/editPayAmount', 'Pay/editPayAmount')
            ->middleware(\app\http\middleware\AdminLog::class,'修改支付金额配置');
        Route::Post('pay/payAmount', 'Pay/payAmount');
        Route::Post('pay/setStatus', 'Pay/setStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改支付金额状态');

    });

    Route::group(function () {
        Route::post('withdrawalList', 'Withdrawal/withdrawalList');
        Route::post('withdrawalReject', 'Withdrawal/withdrawalReject')
            ->middleware(\app\http\middleware\AdminLog::class,'提现驳回');
        Route::post('withdrawalPass', 'Withdrawal/withdrawalPass')
            ->middleware(\app\http\middleware\AdminLog::class,'提现通过');
    });
    Route::group(function () {
        Route::post('rechargeOrder', 'Statistics/rechargeOrder');
        Route::post('rechargeAmount', 'Statistics/rechargeAmount');
        Route::post('userCount', 'Statistics/userCount');
        Route::post('statistics/withdrawal', 'Statistics/withdrawal');
        //Route::post('statistics/consumption', 'Statistics/consumption');
        Route::post('statistics/platformIncome', 'Statistics/platformIncome');
    });
    Route::group(function () {
        Route::post('circleList', 'Circle/circleList');
        Route::post('circleInfo', 'Circle/circleInfo');
        Route::post('commentList', 'Circle/commentList');
        Route::post('delCircle', 'Circle/updateCircleStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改圈子状态');
        Route::post('delCircle', 'Circle/delCircle')
            ->middleware(\app\http\middleware\AdminLog::class,'删除圈子');

    });
    Route::group(function () {
        Route::post('communityList', 'Community/communityList');
        Route::post('updateCommunityStatus', 'Community/updateCommunityStatus')
            ->middleware(\app\http\middleware\AdminLog::class,'修改社群状态');
        Route::post('joinCommunityList', 'Community/joinCommunityList');
        Route::post('updateSort', 'Community/updateSort')
            ->middleware(\app\http\middleware\AdminLog::class,'排序');
        Route::post('addCommunity', 'Community/addCommunity')
            ->middleware(\app\http\middleware\AdminLog::class,'添加社群');
        Route::post('editCommunity', 'Community/editCommunity')
            ->middleware(\app\http\middleware\AdminLog::class,'修改社群');
    });
    Route::group(function () {
        Route::post('module/moduleList', 'Module/moduleList');
        Route::post('template/upTemplate', 'Template/upTemplate') ->middleware(\app\http\middleware\AdminLog::class,'修改板块状态');;
    });

    Route::group(function () {
        Route::post('message/index', 'Message/index');
        Route::post('message/editMessage', 'Message/editMessage')
            ->middleware(\app\http\middleware\AdminLog::class,'修改通知消息');
        Route::post('message/status', 'Message/status')
            ->middleware(\app\http\middleware\AdminLog::class,'修改消息');
        Route::post('message/templateContent', 'Message/templateContent');

        Route::post('message/addRollMessage', 'Message/addRollMessage')
            ->middleware(\app\http\middleware\AdminLog::class,'添加滚动消息');
        Route::post('message/delRollMessage', 'Message/delRollMessage')
            ->middleware(\app\http\middleware\AdminLog::class,'删除滚动消息');
        Route::post('message/rollMessageList', 'Message/rollMessageList');
        Route::post('message/chatMessageLog', 'Message/chatMessageLog');
        Route::post('message/noticeMessage', 'Message/noticeMessage');
        Route::post('message/sendNoticeMessage', 'Message/sendNoticeMessage')
            ->middleware(\app\http\middleware\AdminLog::class,'发送系统消息');
    });
})->middleware(\app\http\middleware\AllowOrigin::class)
    ->middleware(\app\http\middleware\AdminCheckToken::class)
    ->middleware(\app\http\middleware\AuthVerify::class);